import request from '@/utils/request';

export const selectPage = async ({ pageNum, pageSize, ...body }) => {
  return request(
    `/api/mall/admin/points/item/select/page/list?pageSize=${pageSize}&pageNum=${pageNum}`,
    {
      method: 'POST',
      data: body,
    },
  );
};

export const details = async ({ itemId }) => {
  return request(`/api/mall/admin/points/item/details?itemId=${itemId}`, {
    method: 'GET',
  });
};

export const deleteItem = async ({ ids }) => {
  return request(`/api/mall/admin/points/item/deleteByBatch?ids=${ids}`, {
    method: 'DELETE',
    // data: body,
  });
};

export const create = async (body) => {
  return request(`/api/mall/admin/points/item/create/add`, {
    method: 'POST',
    data: body,
  });
};

export const updateInfo = async (body) => {
  return request(`/api/mall/admin/points/item/update`, {
    method: 'PUT',
    data: body,
  });
};
